﻿using UnityEngine;
using System.Collections;
using Game.Scripts.Managers;

namespace Assets.Game.scripts.ui.models { 

    public class HUDModel : MonoBehaviour {

        public FrenzyPeopleController peopleController;
        public ResourceManager resourceManager;
        public BuildingManager buildingManager;

        public int characterCount {
            get {
                if (this.peopleController == null) return 0;
                return this.peopleController.characterCount;
            }
        }

        public int partyCount {
            get {
                if (this.peopleController == null) return 0;
                return this.peopleController.partyCount;
            }
        }

        public uint woodCount {
            get {
                uint retval = 0;
                if (this.resourceManager != null) {
                    Resource woodDeposit = this.resourceManager.getResourceByType(ResourceEnum.Wood);
                    if (woodDeposit != null) {
                        retval = woodDeposit.amount;
                    }
                }
                return retval;
            }
        }

        public uint stoneCount {
            get {
                uint retval = 0;
                if (this.resourceManager != null) {
                    Resource stoneDeposit = this.resourceManager.getResourceByType(ResourceEnum.Stone);
                    if (stoneDeposit != null) {
                        retval = stoneDeposit.amount;
                    }
                }
                return retval;
            }
        }

        public uint foodCount {
            get {
                uint retval = 0;
                if (this.resourceManager != null) {
                    Resource foodDeposit = this.resourceManager.getResourceByType(ResourceEnum.Food);
                    if (foodDeposit != null) {
                        retval = foodDeposit.amount;
                    }
                }
                return retval;
            }
        }

    }

}